<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="template.xhtml">
	<ui:define name="content">
	
	<h1>Ultime prenotazioni da parte dei clienti</h1>
	
	<p:dataTable var="res" value="#{clientReservationBean.allReservations}">  
		<p:column headerText="Utente">  
            <h:outputText value="#{res.user.email}" />  
        </p:column>
		<p:column headerText="Nome pacchetto">  
            <h:outputText value="#{res.package.name}" />  
        </p:column>
        <p:column headerText="Costo totale">  
            <h:outputText value="#{res.price} euro" />  
        </p:column>
        <p:column headerText="Data prenotazione">  
            <h:outputText value="#{res.dateReservation}">
            	<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
            </h:outputText>  
        </p:column> 
        <p:column headerText="Visualizza">  
            <center><p:button outcome="reservationDetails" icon="ui-icon-search" title="Visualizza dettagli">  
			    <f:param name="reservationId" value="#{res.id}" />  
			</p:button></center>
        </p:column>
    </p:dataTable>
	
	</ui:define>
</ui:composition>
</html>